//
//  OrderCell.m
//  HMMarket
//
//  Created by 孙鹏飞 on 2017/5/10.
//  Copyright © 2017年 homai. All rights reserved.
//

#import "OrderCell.h"
#import "OrderModel.h"

@interface OrderCell ()

@property (weak, nonatomic) IBOutlet UIImageView *icon;

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UILabel *price;

@property (weak, nonatomic) IBOutlet UILabel *count;

@property (weak, nonatomic) IBOutlet UILabel *attributeLabel;


@end

@implementation OrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setOrder:(OrderDetail *)order
{
    _order = order;
    
    [_icon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kImageUrl,_order.sm_logo]] placeholderImage:[UIImage imageWithColor:kBackGolor]];
    self.nameLabel.text = _order.item_name;
    self.price.text = [NSString stringWithFormat:@"¥%@/%@",_order.item_price,_order.weight];
    self.count.text = [NSString stringWithFormat:@"X%@",_order.item_number];
    self.attributeLabel.text = _order.item_attr;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
